<template>
  <div>
    <keep-alive>
      <router-view v-if="$route.meta.keepAlive"></router-view>
    </keep-alive>

    <router-view v-if="!$route.meta.keepAlive"></router-view>
    <!-- <div >

        <keep-alive v-if="$route.meta.keepAlive">
          <router-view></router-view>
        </keep-alive>
        <router-view v-else/>
    </div> -->
  </div>
</template>

<script>

export default {
  name: 'App',
  data () {
    return {

    }
  },

  methods: {
    
  },

  create () {
   
  },

  beforeCreate () {
      
  },

  // watch:{
  //   //为了每次切换页面，下个页面滚动位置在顶端。
  //   '$route':function(to,from){

  //     console.log(from);
  //     console.log(to);
  //     document.body.scrollTop = 0;
  //     document.documentElement.scrollTop = 0; 
      
  //   }
  // }
}
</script>

<style>
body{
  margin:0;
}

/*.fade-enter-active, .fade-leave-active {
  transition: opacity 1s;
}
.fade-enter, .fade-leave-to {
  opacity: 0;
}*/

</style>
